<%--
  Created by IntelliJ IDEA.
  User: KangFaWei
  Date: 2019/7/12
  Time: 15:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<ul>
    <c:if test="${empty requestScope.questions}">
        <div style="font-size: 20px;margin-top: 15px;">没有找到与"<span style="color: #1094fa">${param.keyword}</span>"相关的内容</div>
    </c:if>
    <c:forEach items="${requestScope.questions}" var="question">
        <li>
            <h3><a href="<%=path%>/web/question/show?questionId=${question.id}">${question.title}</a></h3>
            <span>提问者：${question.userinfo.nickname}</span>
            <span>答复数：${question.answerCount}</span>
            <p>${fn:substring(question.content, 0,100)}</p>
        </li>
    </c:forEach>
</ul>
<div class="pagination">
    <div class="pagination">
        <span>共${requestScope.pager.pageCount}页</span>
        <c:forEach items="${requestScope.pager.navigatepageNums}" var="num">
            <c:if test="${requestScope.pager.pageNum eq num}" var="cur">
                <a style="color: #ee5f5b;" class="show-page" href="javascript:void(0);">${num}</a>
            </c:if>
            <c:if test="${not cur}">
                <a class="show-page" href="javascript:void(0);">${num}</a>
            </c:if>
        </c:forEach>
    </div>
</div>